<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    Enumeration enu=request.getParameterNames();
    String url="";
    while(enu.hasMoreElements())
    {
        String paraName=(String)enu.nextElement();
        if(!paraName.equals("priceOrder")&&!paraName.equals("SaleOrder")) {
            url += "&" + paraName + "=" + request.getParameter(paraName);
        }
    }
%>
<html  ng-app="validationApp">
<head>
    <title></title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/resources/css/history.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <link href="<%=request.getContextPath() %>/resources/css/form.css" rel="stylesheet" type="text/css" media="all" />
    <link href="<%=request.getContextPath() %>/resources/css/main/style.css" rel="stylesheet" type="text/css" media="all" />
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/jquery1.min.js"></script>
    <script src="<%=request.getContextPath() %>/resources/js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/megamenu.js"></script>
    <script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
    <script src="<%=request.getContextPath() %>/resources/js/jquery.easydropdown.js"></script>
    <script>

        function orderBysale() {

            window.location = "?SaleOrder=desc<%=url%>";
        }
        function orderByQuery() {

            var str="";
            if($("#brand").val()!=""){
                str="brand="+$("#brand").val()+"&"
            }
            if($('input[name="price"]:checked').val()!="")
            {
                str+="price="+$('input[name="price"]:checked').val()+"&"
            }
            if($('input[name="cpu"]:checked').val()!="")
            {
                str+="CPU="+$('input[name="cpu"]:checked').val()+"&"
            }
            window.location="<%=request.getContextPath() %>/goods/${category}/search?"+str;
        }
    </script>
    <script type="text/javascript">
        $(function(){
            $(".yScrollListTitle h1").click(function  () {
                var index=$(this).index(".yScrollListTitle h1");
                $(this).addClass("yth1click").siblings().removeClass("yth1click");
                $($(".yScrollListInList")[index]).show().siblings().hide();
            });
            $(".yScrollListInList1 ul").css({width:$(".yScrollListInList1 ul li").length*(160+84)+"px"});
            var numwidth=(160+84)*5;
            $(".yScrollListInList .yScrollListbtnl").click(function(){
                var obj=$(this).parent(".yScrollListInList").find("ul");
                if (!(obj.is(":animated"))) {
                    var lefts=parseInt(obj.css("left").slice(0,-2));
                    if(lefts<30){
                        obj.animate({left:lefts+numwidth},1000);
                    }
                }
            });
            $(".yScrollListInList .yScrollListbtnr").click(function(){
                var obj=$(this).parent(".yScrollListInList").find("ul");
                var objcds=-(30+(Math.ceil(obj.find("li").length/5)-2)*numwidth);
                if (!(obj.is(":animated"))) {
                    var lefts=parseInt(obj.css("left").slice(0,-2));
                    if(lefts>objcds){
                        obj.animate({left:lefts-numwidth},1000);
                    }
                }
            })
        })
    </script>
</head>
<body>
<div id="container">
    <%@include file="/jsp/public/top.jspf"%>
        <div id="mainbody" >
            <div class="womens">
                <div class="main">
                <div class="wrap">
                    <div class="cont span_2_of_3">
                        <h2 class="head">笔记本</h2>
                        <div class="mens-toolbar">
                                    <div class="btn-group" role="group" aria-label="...">
                                        <button type="button" onclick="orderBysale()" class="btn btn-default" onclick="" >销量</button>
                                        <div class="btn-group" role="group">
                                            <button type="button"  class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                                价格<span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu" role="menu">
                                                <li>

                                                    <a href="?priceOrder=asc<%=url%>">
                                                        价格从低到高
                                                    </a>
                                                </li>
                                                <li><a href="?priceOrder=desc<%=url%>">价格从高到低</a></li>
                                            </ul>
                                        </div>
                                    </div>


                            <div class="pager"  style="float: right;width:400px">
                                <ul class="dc_pagination dc_paginationA dc_paginationA06">
                                    <jsp:include page="/jsp/public/pager.jsp">
                                        <jsp:param value="${MatchedGoods.total }" name="totalRecord"/>
                                        <jsp:param value="search" name="url"/>
                                    </jsp:include>
                                </ul>

                            </div>
                            <div class="clear"></div>
                        </div>
                        <c:forEach items="${goodsList}" var="smallGoodsList">

                            <div class="top-box">
                            <c:forEach items="${smallGoodsList}" var="goods">
                                <div class="col_1_of_3 span_1_of_3">
                                    <a href="<%=request.getContextPath() %>/goods/goodsDetail/${goods.id}">
                                        <div class="inner_content clearfix">
                                            <div class="product_image">
                                                <img src="<%=request.getContextPath() %>/resources/images/goodsImages/${goods.image}" style="border: 0px" alt=""/>
                                            </div>
                                            <div class="sale-box"><span class="on_sale title_shop">New</span></div>
                                            <div class="price">
                                                <div class="cart-left">
                                                    <p class="title">${goods.name}</p>
                                                    <div class="price1">
                                                        <span class="actual">RMB:${goods.price}</span>
                                                    </div>
                                                </div>
                                                <div class="cart-right"> </div>
                                                <div class="clear"></div>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                            </c:forEach>
                                <div class="clear"></div>
                            </div>
                        </c:forEach>

                        <br>
                        <c:if test="${!empty loginUser}">
                        <div class="yScrollList container">
                            <div class="yScrollListTitle"><h1 class="yth1click">浏览记录</h1><h1 class="ytitleh12">猜你喜欢</h1></div>
                            <div class="yScrollListIn">
                                <div class="yScrollListInList yScrollListInList1" style="display:block;">
                                    <ul>
                                        <c:forEach items="${historyList}" var="hgoods">
                                            <li>
                                                <a href="<%=request.getContextPath() %>/goods/goodsDetail/${hgoods.id}">
                                                    <img class="img-responsive" src="<%=request.getContextPath() %>/resources/images/goodsImages/${hgoods.image}" alt="">
                                                    <p>${hgoods.name}</p>
                                                    <span>￥${hgoods.price}</span>
                                                </a>
                                            </li>
                                        </c:forEach>
                                    </ul>
                                    <div class="yScrollListbtn yScrollListbtnl"></div>
                                    <div class="yScrollListbtn yScrollListbtnr"></div>
                                </div>
                            </div>
                        </div>
                        </c:if>
                    </div>
                    <div class="rsidebar span_1_of_left">
                        <h5 class="m_1">品牌</h5>
                        <select  id="brand" class="dropdown" tabindex="8" data-settings='{"wrapperClass":"metro"}'>
                            <option value="">不限</option>
                            <option value="Apple">苹果</option>
                            <option value="Lenovo">联想</option>
                        </select>
                        <ul class="kids">
                            <li><a href="#"></a></li>
                        </ul>
                        <section  class="sky-form">
                            <h4>价格</h4>
                            <div class="row row1 scroll-pane">
                                <label class="checkbox"><input type="radio" value="" name="price" checked=""><i></i>不限</label>
                                    <label class="checkbox"><input type="radio" value="0-2999" name="price" ><i></i>0-2999</label>
                                    <label class="checkbox"><input type="radio" value="3000-3999" name="price"><i></i>3000-3999</label>
                                    <label class="checkbox"><input type="radio" value="4000-4999" name="price"><i></i>4000-4999</label>
                                    <label class="checkbox"><input type="radio" value="5000-5999" name="price"><i></i>5000-5999</label>
                                    <label class="checkbox"><input type="radio" value="6000-200000" name="price"><i></i>6000-200000</label>
                            </div>
                        </section>
                        <section  class="sky-form" >
                            <h4>CPU</h4>
                            <div class="row row1" >
                                <div class="col col-4">
                                    <label class="checkbox"><input type="radio" value="" name="cpu" checked=""><i></i>不限</label>
                                    <label class="checkbox"><input type="radio" value="Intel i3" name="cpu"><i></i>Intel i3</label>
                                    <label class="checkbox"><input type="radio" value="Intel i5" name="cpu"><i></i>Intel i5</label>
                                    <label class="checkbox"><input type="radio" value="Intel i7" name="cpu"><i></i>Intel i7</label>

                                    <label class="checkbox"><input type="radio" value="AMD A8" name="cpu"><i></i>AMD A8</label>
                                    <label class="checkbox"><input type="radio" value="AMD A10" name="cpu"><i></i>AMD A10</label>
                                </div>
                            </div>
                        </section>
                        <section  class="sky-form">
                            <h4>Colors</h4>
                            <ul class="color-list">
                                <li><a href="#" onclick="orderByQuery()"> <span class="color1"> </span><p class="red">Red</p></a></li>
                                <li><a href="#" onclick="orderByQuery()"> <span class="color2"> </span><p class="red">Green</p></a></li>
                                <li><a href="#" onclick="orderByQuery()"> <span class="color3"> </span><p class="red">Blue</p></a></li>
                                <li><a href="#" onclick="orderByQuery()"> <span class="color7"> </span><p class="red">Gray</p></a></li>
                            </ul>
                        </section>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>

            </div>


            <br>
        </div>
    <div class="footPush"></div>
</div>
<%@include file="/jsp/public/footer.jspf"%>
</body>
</html>
